<?php
/**
 * Created by PhpStorm.
 * User: zl
 * Date: 2017/6/18
 * Time: 14:08
 */

    require_once('../BusinessApprove/BusinessApp.php');
    require_once('../Common.php');
    require_once ('PDFCreator.php');
    $appID = $_REQUEST['appID'];
    $b_app = new BusinessApp();

    $data = $b_app->getLoanCarInfo($appID);
    $result_array = array();

    if($data){
        $pdf = new PDFCreator();
        $url = $pdf->createLoanCarPDF($data);
        $result_array['state'] = 1;
        $result_array['state_error'] = '';
        $result_array['url'] = $url;
    }
    else{
        $result_array['state'] = 0;
        $result_array['state_error'] = 'DB_ERROR';
    }

    echo json_encode($result_array);


?>